import axios from 'axios'
import { getToken, setToken } from '@/utils/auth'

const service = axios.create({
    // baseURL: "/baseUrl", // url = base url + request url
    baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
    // withCredentials: true, // send cookies when cross-domain requests
    timeout: 0, // request timeout
})
service.interceptors.request.use(config => {
	config.headers['authorization'] = getToken();
	config.headers['Content-Type'] = 'application/json';
	return config
})



export default service
